#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h> 
#include <linux/time.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>

struct timeval tv1;
struct timeval tv2;

static int proc_call(char *buf, char **start, off_t off, 
                        int count, int *eof, void *data)
{
         int len = 0;
         len = sprintf(buf + len, "%s", "hello china\n");
         len += sprintf(buf + len, "%s", "hello world\n");
       //  return tv1.tv_usec-tv2.tv_usec;
	 //*start=buf;
       return len;
}
 
static int __init procread_init()
{
        struct proc_dir_entry *entry;
         entry = create_proc_read_entry("proc_read", 0, NULL, proc_call, NULL);
         if (!entry)
         {
                 goto create_err;
         }

	do_gettimeofday(&tv2);

	// printk("do_gettimeofday do_gettimeofday do_gettimeofday..\n");
	msleep(100);
	do_gettimeofday(&tv1);
	printk("s=%d,us=%d\n",tv1.tv_sec-tv2.tv_sec,tv1.tv_usec-tv2.tv_usec);
         return 0;
 create_err:
         return -1;
}

static void __exit procread_exit()
{
        remove_proc_entry("proc_read", NULL);
	printk("Module is leaving..\n");
}

module_init(procread_init);
module_exit(procread_exit);
MODULE_LICENSE("GPL");


